package com.situ.day7;

//Java是单继承
//如果一个类没有继承任何一个类，默认继承Object
//写到父类里面的属性和方法是所有子类共有
//大驼峰 StudentManager 小驼峰
public class Person extends Object{
    //如果希望子类访问的属性可以设置为protected
    protected int id;
    protected String name;
    protected int age;

    //final  finally  finalize

    //构造方法重载
    public Person() {
        //super();// new Object()
        System.out.println("Person.Person");
    }

    public Person(int id, String name, int age) {
        //super();// new Object()
        this.id = id;
        this.name = name;
        this.age = age;
    }

    //重载
    public void show() {
        System.out.println("Person.show");
    }

    public void show(int age) {

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
